Page({
    data: {
        lists: []
    },
    onLoad: function (options) {
        let lists = [];
        for (let i = 0; i < 20; i++) {
            lists.push(i);
        }
        setTimeout(() => {
            this.setData({
                lists
            })
        }, 1500)
    },
    // 下拉事件
    pullDown() { 
        const child = this.selectComponent('#refresher');
        this.setData({
            lists: [],
            showIntoView: true,
        })
        child.setData({
            showIntoView:false,
        })
        setTimeout(() => {
            child.fresherrefreshEnd()
        }, 1500)
    },
    // 上拉事件 
    pullUp() {
        console.log("上拉");
        const child = this.selectComponent('#refresher');
        child.setData({
            showIntoView: true,
        })
        let item = this.data.lists;
        for (let i = 0; i < 20; i++) {
            item.push(i);
        }
        setTimeout(() => {
            this.setData({
                lists: item.concat(this.data.lists),
            })
            child.fresherrefreshEnd();
        }, 1500)
    }
})